package com.example.qxfw.slhx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.yj.HxyjYzdisppara;
import com.example.qxfw.slhx.mapper.HxyjYzdispparaMapper;
import com.example.qxfw.slhx.service.HxyjYzdispparaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class HxyjYzdispparaServiceImpl implements HxyjYzdispparaService {

    @Autowired
    private HxyjYzdispparaMapper hxyjYzdispparaMapper;

    @Override
    public List<HxyjYzdisppara> listByIndex(Integer index) {
        return hxyjYzdispparaMapper.selectList(Wrappers.<HxyjYzdisppara>lambdaQuery()
                .eq(HxyjYzdisppara::getFactorindex,index));
    }

    @Override
    public List<HxyjYzdisppara> getList() {
        return hxyjYzdispparaMapper.selectList(Wrappers.<HxyjYzdisppara>lambdaQuery());
    }

    @Override
    public HxyjYzdisppara save(HxyjYzdisppara HxyjYzdisppara) {
        int rows = hxyjYzdispparaMapper.insert(HxyjYzdisppara);
        return rows>0?HxyjYzdisppara:null;
    }

    @Override
    public HxyjYzdisppara updateById(HxyjYzdisppara HxyjYzdisppara) {
        int rows = hxyjYzdispparaMapper.updateById(HxyjYzdisppara);
        return rows>0?HxyjYzdisppara:null;
    }

    @Override
    public Integer deleteById(Integer id) {
        return hxyjYzdispparaMapper.deleteById(id);
    }
}

